package sixkey.Exception;

import sixkey.utils.ResCodeEnum;

/**
 * ClassName:UserNameExistException
 * Package:sixkey.Exception
 * Description
 *
 * @Author:@wenxueshi
 * @Create:2023/5/20 - 17:57
 * @Version:v1.0
 */

/**
 * 用户名已存在异常类
 */
public class UserNameExistException extends Exception{
    private int code;
    private String message;

    public UserNameExistException(ResCodeEnum resCodeEnum){
        super(resCodeEnum.getMessage());
        this.code = resCodeEnum.getCode();
        this.message = resCodeEnum.getMessage();
    }

    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
